package com.sh.data.engine.domain.datadev.offline.model.enums;

import java.util.Objects;

public enum OfflineDevTaskStopEnum {
    TASK_FLOW(0, "/offlineDev/task/stop"),
    DATA_QUALITY(1, "/offlineDev/dataquality/stop"),
    OPERATION_TASK(2, "/offlineDev/operation/task/stop"),
    OFFLINE_SYNC(3, "/integration/offline/stop"),
    API_SYNC(4, "/integration/api/http/stop"),
    WS_SYNC(5, "/integration/api/ws/stop");

    private int code;

    private String url;

    private static final OfflineDevTaskStopEnum[] VALUES;

    OfflineDevTaskStopEnum(int code, String url) {
        this.code = code;
        this.url = url;
    }

    static {
        VALUES = values();
    }

    public int getCode() {
        return code;
    }

    public String getUrl() {
        return url;
    }

    public static OfflineDevTaskStopEnum of(int id) {
        for (OfflineDevTaskStopEnum nodeTypeEnum : VALUES) {
            if (Objects.equals(nodeTypeEnum.code, id)) {
                return nodeTypeEnum;
            }
        }
        return null;
    }
}
